// 字符串 "" 或''
let name = "along";
let sex = "男";
let person = "\"" + name + "\""+ "'" +sex + "'";
let person2 = `"${name}"'${sex}'`;
console.log(person,person2);

// 模板字符串 
let name = "along";
let sex = "男";
let person2 = '"${name}"\'${sex}\'';
person2 = person2.replace(/\$\{([^}]+)\}/g,function() {
    return eval(arguments[1]);
});
console.log(person2);

let arr = [1,2,3];
let str = `${arr.join(",")}`;
console.log(str);

let arr2 = ["along","男"];
let newArr = arr2.map(function(item) {
    return `
       <li>
            ${item}
       </li>`; 
});
let domHTML = `<ul>${newArr.join("")}</ul>`;
console.log(domHTML);

let name = "along";
let sex = "男";
function fn(arr,...args) {
    // arr ["名字是:","性别",""] args ["along","男"]
    let str = "";
    for(let i=0; i<args.length; i++) {
        str += (arr[i]+args[i]+"@");
    }
    return str;
}
let str = fn`名字是:${name}性别${sex}`;
console.log(str);

// includes startsWith endsWith padStart padEnd
console.log("ahshjasd".includes("jea"));
console.log("3".padEnd(2,0));

